package demogeneric;

/**
 * 泛型类
 * <T> 表示当前类是一个泛型类
 */
public class MyArray<T /*extends Number*/> {
    public Object[] array = new Object[3];

    public void setArray(int pos, T val) {
        array[pos] = val;
    }

    public T getVal(int pos) {
        return (T)array[pos];
    }
}
